home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume7 / vttest / part1 next >
Encoding:
Internet Message Format  |  1986-11-30  |  15.5 KB

  1. Subject:  v07i016:  Test VT100 features, Part01/02
  2. Newsgroups: mod.sources
  3. Approved: mirror!rs
  4.  
  5. Submitted by: seismo!enea!suadb!lindberg (Per Lindberg QZ)
  6. Mod.sources: Volume 7, Issue 16
  7. Archive-name: vttest/Part01
  8.  
  9. [  See my comments at the beginning of the README.  -r$  ]
  10.  
  11.  
  12. #!/bin/sh
  13. # This is a shell archive.  Remove anything before this line,
  14. # then unpack it by saving it in a file and typing "sh file".
  15. # Wrapped by mirror!rs on Tue Sep  2 17:04:20 EDT 1986
  16.  
  17. # Exit status; set to 1 on "wc" errors or if would overwrite.
  18. STATUS=0
  19. # Contents:  Makefile README vttest.1 esc.c header.h
  20.  
  21. echo x - Makefile
  22. if test -f Makefile ; then
  23.     echo Makefile exists, putting output in $$Makefile
  24.     OUT=$$Makefile
  25.     STATUS=1
  26. else
  27.     OUT=Makefile
  28. fi
  29. sed 's/^XX//' > $OUT <<'@//E*O*F Makefile//'
  30. XXCFLAGS    = -O
  31. XXOBJS    = main.o esc.o
  32.  
  33. XXvttest:    $(OBJS)
  34. XX    cc $(CFLAGS) -o vttest $(OBJS)
  35.  
  36. XXinstall: vttest
  37. XX    cp vttest.1 /usr/man/man1/vttest.1
  38. XX    cp vttest /usr/local/bin/vttest
  39. XX    strip /usr/local/bin/vttest
  40.  
  41. XXclean:
  42. XX    rm -f $(OBJS) vttest foo core lint tags a.out
  43. @//E*O*F Makefile//
  44. chmod u=rw,g=rw,o=rw $OUT
  45.  
  46. echo x - README
  47. if test -f README ; then
  48.     echo README exists, putting output in $$README
  49.     OUT=$$README
  50.     STATUS=1
  51. else
  52.     OUT=README
  53. fi
  54. sed 's/^XX//' > $OUT <<'@//E*O*F README//'
  55. XXNOTES FROM THE MOD.SOURCES MODERATOR:
  56. XXI split the source up into the three separate pieces it now is.
  57. XXIn doing this, I put lines like "int reading;" in a header file
  58. XXthat both C modules include.  If your Unix requires one of these
  59. XXto be "extern int reading;" then you will have some editing to do.
  60. XXAlso note that this program uses FIONREAD, which must be implemented
  61. XXdifferently in SystemV, etc., and check out the setjmp() call...
  62. XX    /Rich $alz
  63. XXOh, yeah:  I also wrote the Makefile and manpage, such as they are.
  64. XX-------------------------------------------------------------------
  65.  
  66. XXThis is a program to test the compatibility (or to demonstrate the
  67. XXnon-compatibility) of so-called "VT100-compatible" terminals. In
  68. XXconformance of the good old hacker traditions, the only documentation
  69. XXof this program is the source code itself. To understand it, you also
  70. XXneed a copy of the original VT100 manual from DEC.
  71.  
  72. XXComments and bug reports: Since this is a release (via USENET) to the
  73. XXwhole world, a lot of people are going to have opinions and fresh
  74. XXideas about it. (What -- bugs in MY program? Aww...)  I can't deal
  75. XXwith everyone sending me a hacked version, but if you have found a
  76. XXserious bug, or ported it to VMS, do tell me. I can't promise any new
  77. XXversion release, though. From this version on (1.7b) VTTEST will have
  78. XXto live its own life without its father holding its hand.
  79.  
  80. XXMy adress is:
  81.  
  82. XXNetwork-mail adress:     (mcvax,seismo)!enea!suadb!lindberg
  83.  
  84. XXReal-world-mail address: Per Lindberg
  85. XX                         QZ, Stockholm University Computing Center
  86. XX             Box 27322
  87. XX             S - 102 54  Stockholm
  88. XX             SWEDEN
  89.  
  90. XXThe original version of this program is written for the Sargasso C
  91. XXcompiler for the DECsystem-10. Many thanks to all sales persons with
  92. XXquote VT100-compatible unquote terminals, who prompted me to write
  93. XXthis program, and also to:
  94.  
  95. XX-- Bo Kleve, LIDAC, Linkoping University, Sweden
  96. XX   for the portation to DECSYSTEM-20 with the Sargasso C compiler
  97.  
  98. XX-- Johan Widen, TTDS, Royal Institute of Technology, Stockholm, Sweden
  99. XX   for the portation to various UNIX systems (incl. System III and Xenix)
  100.  
  101. XX-- Russ Herman, AES Data Inc., Missisauga, Ont. Canada
  102. XX   for fixes and code for the VT102 test
  103.  
  104. XXThanx also to JMR "Gremlin" at KTH, and Goran Wallberg at QZ
  105. XXfor suggestions, bug fixes, etc.
  106.  
  107. XXThis program does not have support for all the different variations
  108. XXof VT100, like VT125, VT131 nor the new VT200 series. Feel free to
  109. XXadd that yourself. Happy Hacking!
  110.  
  111. XX                 /TMP
  112. @//E*O*F README//
  113. chmod u=rw,g=rw,o=rw $OUT
  114.  
  115. echo x - vttest.1
  116. if test -f vttest.1 ; then
  117.     echo vttest.1 exists, putting output in $$vttest.1
  118.     OUT=$$vttest.1
  119.     STATUS=1
  120. else
  121.     OUT=vttest.1
  122. fi
  123. sed 's/^XX//' > $OUT <<'@//E*O*F vttest.1//'
  124. XX.TH VTTEST 1 "LOCAL"
  125. XX.SH NAME
  126. XXvttest \- test VT100-type terminal
  127. XX.SH SYNOPSIS
  128. XX.B vttest
  129. XX.SH DESCRIPTION
  130. XX.I Vttest
  131. XXis a program designed to test the functionality of a VT100 terminal
  132. XX(or emulator thereof).
  133. XXIt tests both display (escape sequence handling) and keyboard.
  134. XX.PP
  135. XXThe program is menu\-driven and contains full on\-line operating
  136. XXinstructions.
  137. @//E*O*F vttest.1//
  138. chmod u=rw,g=rw,o=rw $OUT
  139.  
  140. echo x - esc.c
  141. if test -f esc.c ; then
  142.     echo esc.c exists, putting output in $$esc.c
  143.     OUT=$$esc.c
  144.     STATUS=1
  145. else
  146.     OUT=esc.c
  147. fi
  148. sed 's/^XX//' > $OUT <<'@//E*O*F esc.c//'
  149. XX#include "header.h"
  150.  
  151. XXprintln(s) char *s; {
  152. XX  printf("%s\n", s);
  153. XX}
  154.  
  155. XXesc(s) char *s; {
  156. XX  printf("%c%s", 27, s);
  157. XX}
  158.  
  159. XXesc2(s1, s2) char s1, s2; {
  160. XX  printf("%c%s%s", 27, s1, s2);
  161. XX}
  162.  
  163. XXbrcstr(ps, c) char *ps, c; {
  164. XX  printf("%c[%s%c", 27, ps, c);
  165. XX}
  166.  
  167. XXbrc(pn,c) int pn; char c; {
  168. XX  printf("%c[%d%c", 27, pn, c);
  169. XX}
  170.  
  171. XXbrc2(pn1, pn2 ,c) int pn1, pn2; char c; {
  172. XX  printf("%c[%d;%d%c", 27, pn1, pn2, c);
  173. XX}
  174.  
  175. XXcub(pn) int pn; {  /* Cursor Backward */
  176. XX  brc(pn,'D');
  177. XX}
  178. XXcud(pn) int pn; {  /* Cursor Down */
  179. XX  brc(pn,'B');
  180. XX}
  181. XXcuf(pn) int pn; {  /* Cursor Forward */
  182. XX  brc(pn,'C');
  183. XX}
  184. XXcup(pn1, pn2) int pn1, pn2; {  /* Cursor Position */
  185. XX  brc2(pn1, pn2, 'H');
  186. XX}
  187. XXcuu(pn) int pn; {  /* Cursor Up */
  188. XX  brc(pn,'A');
  189. XX}
  190. XXda() {  /* Device Attributes */
  191. XX  brc(0,'c');
  192. XX}
  193. XXdecaln() {  /* Screen Alignment Display */
  194. XX  esc("#8");
  195. XX}
  196. XXdecdhl(lower) int lower; {  /* Double Height Line (also double width) */
  197. XX  if (lower) esc("#4");
  198. XX  else       esc("#3");
  199. XX}
  200. XXdecdwl() {  /* Double Wide Line */
  201. XX  esc("#6");
  202. XX}
  203. XXdeckpam() {  /* Keypad Application Mode */
  204. XX  esc("=");
  205. XX}
  206. XXdeckpnm() {  /* Keypad Numeric Mode */
  207. XX  esc(">");
  208. XX}
  209. XXdecll(ps) char *ps; {  /* Load LEDs */
  210. XX  brcstr(ps, 'q');
  211. XX}
  212. XXdecrc() {  /* Restore Cursor */
  213. XX  esc("8");
  214. XX}
  215. XXdecreqtparm(pn) int pn; {  /* Request Terminal Parameters */
  216. XX  brc(pn,'x');
  217. XX}
  218. XXdecsc() {  /* Save Cursor */
  219. XX  esc("7");
  220. XX}
  221. XXdecstbm(pn1, pn2) int pn1, pn2; {  /* Set Top and Bottom Margins */
  222. XX  if (pn1 || pn2) brc2(pn1, pn2, 'r');
  223. XX  else            esc("[r");
  224. XX  /* Good for >24-line terminals */
  225. XX}
  226. XXdecswl() {  /* Single With Line */
  227. XX  esc("#5");
  228. XX}
  229. XXdectst(pn) int pn; {  /* Invoke Confidence Test */
  230. XX  brc2(2, pn, 'y');
  231. XX}
  232. XXdsr(pn) int pn; {  /* Device Status Report */
  233. XX  brc(pn, 'n');
  234. XX}
  235. XXed(pn) int pn; {  /* Erase in Display */
  236. XX  brc(pn, 'J');
  237. XX}
  238. XXel(pn) int pn; {  /* Erase in Line */
  239. XX  brc(pn,'K');
  240. XX}
  241. XXhts() {  /* Horizontal Tabulation Set */
  242. XX  esc("H");
  243. XX}
  244. XXhvp(pn1, pn2) int pn1, pn2; {  /* Horizontal and Vertical Position */
  245. XX  brc2(pn1, pn2, 'f');
  246. XX}
  247. XXind() {  /* Index */
  248. XX  esc("D");
  249. XX}
  250. XXnel() {  /* Next Line */
  251. XX  esc("E");
  252. XX}
  253. XXri() {  /* Reverse Index */
  254. XX  esc("M");
  255. XX}
  256. XXris() { /*  Reset to Initial State */
  257. XX  esc("c");
  258. XX}
  259. XXrm(ps) char *ps; {  /* Reset Mode */
  260. XX  brcstr(ps, 'l');
  261. XX}
  262. XXscs(g,c) int g; char c; {  /* Select character Set */
  263. XX  printf("%c%c%c%c%c%c%c", 27, g ? ')' : '(', c,
  264. XX                           27, g ? '(' : ')', 'B',
  265. XX               g ? 14 : 15);
  266. XX}
  267. XXsgr(ps) char *ps; {  /* Select Graphic Rendition */
  268. XX  brcstr(ps, 'm');
  269. XX}
  270. XXsm(ps) char *ps; {  /* Set Mode */
  271. XX  brcstr(ps, 'h');
  272. XX}
  273. XXtbc(pn) int pn; {  /* Tabulation Clear */
  274. XX  brc(pn, 'g');
  275. XX}
  276.  
  277. XXvt52cup(l,c) int l,c; {
  278. XX  printf("%cY%c%c", 27, l + 31, c + 31);
  279. XX}
  280.  
  281. XXchar inchar() {
  282.  
  283. XX  /*
  284. XX   *   Wait until a character is typed on the terminal
  285. XX   *   then read it, without waiting for CR.
  286. XX   */
  287.  
  288. XX#ifdef UNIX
  289. XX  int lval, waittime, getpid(); static int val; char ch;
  290.  
  291. XX  fflush(stdout);
  292. XX  lval = val;
  293. XX  brkrd = 0;
  294. XX  reading = 1;
  295. XX  read(0,&ch,1);
  296. XX  reading = 0;
  297. XX  if (brkrd)
  298. XX    val = 0177;
  299. XX  else
  300. XX    val = ch;
  301. XX  if ((val==0177) && (val==lval))
  302. XX    kill(getpid(), (int) SIGTERM);
  303. XX#endif
  304. XX#ifdef SARG10
  305. XX  int val, waittime;
  306.  
  307. XX  waittime = 0;
  308. XX  while(!uuo(051,2,&val)) {        /* TTCALL 2, (INCHRS)    */
  309. XX    zleep(100);                /* Wait 0.1 seconds    */
  310. XX    if ((waittime += ttymode) > 600)    /* Time-out, in case    */
  311. XX      return('\177');            /* of hung in ttybin(1)    */
  312. XX  }
  313. XX#endif
  314. XX#ifdef SARG20    /* try to fix a time-out function */
  315. XX  int val, waittime;
  316.  
  317. XX  waittime = 0;
  318. XX  while(jsys(SIBE,2,_PRIIN) == 0) {    /* Is input empty? */
  319. XX    zleep(100);
  320. XX    if ((waittime += ttymode) > 600)
  321. XX      return('\177');
  322. XX  }
  323. XX  ejsys(BIN,_PRIIN);
  324. XX  val = jsac[2];
  325. XX#endif
  326. XX  return(val);
  327. XX}
  328.  
  329. XXchar *instr() {
  330.  
  331. XX  /*
  332. XX   *   Get an unfinished string from the terminal:
  333. XX   *   wait until a character is typed on the terminal,
  334. XX   *   then read it, and all other available characters.
  335. XX   *   Return a pointer to that string.
  336. XX   */
  337.  
  338.  
  339. XX  int i, val, crflag; long l1; char ch;
  340. XX  static char result[80];
  341.  
  342. XX  i = 0;
  343. XX  result[i++] = inchar();
  344. XX/* Wait 0.1 seconds (1 second in vanilla UNIX) */
  345. XX#ifdef SARG10
  346. XX  if (trmop(01031,0) < 5) zleep(500); /* wait longer if low speed */
  347. XX  else                    zleep(100);
  348. XX#else
  349. XX  zleep(100);
  350. XX#endif
  351. XX#ifdef UNIX
  352. XX  fflush(stdout);
  353. XX#ifdef XENIX
  354. XX  while(rdchk(0)) {
  355. XX    read(0,result+i,1);
  356. XX    if (i++ == 78) break;
  357. XX  }
  358. XX#else
  359. XX#ifdef SIII
  360. XX  while(read(2,result+i,1) == 1)
  361. XX    if (i++ == 78) break;
  362. XX#else
  363. XX  while(ioctl(0,FIONREAD,&l1), l1 > 0L) {
  364. XX    while(l1-- > 0L) {
  365. XX      read(0,result+i,1);
  366. XX      if (i++ == 78) goto out1;
  367. XX    }
  368. XX  }
  369. XXout1:
  370. XX#endif
  371. XX#endif
  372. XX#endif
  373. XX#ifdef SARG10
  374. XX  while(uuo(051,2,&val)) {    /* TTCALL 2, (INCHRS)  */
  375. XX    if (!(val == '\012' && crflag))    /* TOPS-10 adds LF to CR */
  376. XX      result[i++] = val;
  377. XX    crflag = val == '\015';
  378. XX    if (i == 79) break;
  379. XX    zleep(50);          /* Wait 0.05 seconds */
  380. XX  }
  381. XX#endif
  382. XX#ifdef SARG20
  383. XX  while(jsys(SIBE,2,_PRIIN) != 0) {    /* read input until buffer is empty */
  384. XX    ejsys(BIN,_PRIIN);
  385. XX    result[i++] = jsac[2];
  386. XX    if (i == 79) break;
  387. XX    zleep(50);        /* Wait 0.05 seconds */
  388. XX  }
  389. XX#endif
  390. XX  result[i] = '\0';
  391. XX  return(result);
  392. XX}
  393.  
  394. XXttybin(bin) int bin; {
  395. XX#ifdef SARG10
  396. XX  #define OPEN 050
  397. XX  #define IO_MOD 0000017
  398. XX  #define _IOPIM 2
  399. XX  #define _IOASC 0
  400. XX  #define _TOPAG 01021
  401. XX  #define _TOSET 01000
  402.  
  403. XX  int v;
  404. XX  static int arglst[] = {
  405. XX    _IOPIM,
  406. XX    `TTY`,
  407. XX    0    
  408. XX  };
  409. XX  arglst[0] = bin ? _IOPIM : _IOASC;
  410. XX  v = uuo(OPEN, 1, &arglst[0]);
  411. XX  if (!v) { printf("OPEN failed"); exit(); }
  412. XX  trmop(_TOPAG + _TOSET, bin ? 0 : 1);
  413. XX  ttymode = bin;
  414. XX#endif
  415. XX#ifdef SARG20
  416. XX  /*    TTYBIN will set the line in BINARY/ASCII mode
  417. XX   *    BINARY mode is needed to send control characters
  418. XX   *    Bit 28 must be 0 (we don't flip it).
  419. XX   *    Bit 29 is used for the mode change.
  420. XX   */
  421.  
  422. XX  #define _TTASC 0000100
  423. XX  #define _MOXOF 0000043
  424.  
  425. XX  int v;
  426.  
  427. XX  ejsys(RFMOD,_CTTRM);
  428. XX  v = ejsys(SFMOD,_CTTRM, bin ? (~_TTASC & jsac[2]) : (_TTASC | jsac[2]));
  429. XX  if (v) { printf("SFMOD failed"); exit(); }
  430. XX  v = ejsys(MTOPR,_CTTRM,_MOXOF,0);
  431. XX  if (v) { printf("MTOPR failed"); exit(); }
  432. XX#endif
  433. XX}
  434.  
  435. XX#ifdef SARG20
  436. XX/*
  437. XX *    SUPERBIN turns off/on all input character interrupts
  438. XX *    This affects ^C, ^O, ^T
  439. XX *    Beware where and how you use it !!!!!!!
  440. XX */
  441.  
  442. XXsuperbin(bin) int bin; {
  443. XX  int v;
  444.  
  445. XX  v = ejsys(STIW,(0//-5), bin ? 0 : -1);
  446. XX  if (v) { printf("STIW superbinary setting failed"); exit(); }
  447. XX  ttymode = bin;
  448. XX}
  449.  
  450. XX/*
  451. XX *    PAGE affects the ^S/^Q handshake.
  452. XX *    Set bit 34 to turn it on. Clear it for off.
  453. XX */
  454.  
  455. XXpage(bin) int bin; {
  456. XX  int v;
  457.  
  458. XX  #define TT_PGM 0000002
  459.  
  460. XX  ejsys(RFMOD,_CTTRM);    /* Get the current terminal status */
  461. XX  v = ejsys(STPAR,_CTTRM, bin ? (TT_PGM | jsac[2]) : (~TT_PGM & jsac[2]));
  462. XX  if (v) { printf("STPAR failed"); exit(); }
  463. XX}
  464. XX#endif
  465.  
  466. XXtrmop(fc,arg) int fc, arg; {
  467. XX#ifdef SARG10
  468. XX  int retvalp;
  469. XX  int arglst[3];
  470.  
  471. XX  /* TRMOP is a TOPS-10 monitor call that does things to the terminal. */
  472.  
  473. XX  /* Find out TTY nbr (PA1050 barfs if TRMOP get -1 instead of udx)    */
  474. XX  /* A TRMNO monitor call returns the udx (Universal Device Index)     */
  475.  
  476. XX  arglst[0] = fc;        /* function code    */
  477. XX  arglst[1] = calli(0115, -1);    /* udx, TRMNO. UUO    */
  478. XX  arglst[2] = arg;        /* Optional argument    */
  479.  
  480. XX  if (calli(0116, 3 // &arglst[0], &retvalp))           /* TRMOP. UUO */
  481. XX  return (retvalp);
  482. XX  else {
  483. XX    printf("?Error return in TRMOP.");
  484. XX    exit();
  485. XX  }
  486. XX#endif
  487. XX}
  488.  
  489. XXinputline(s) char *s; {
  490. XX  scanf("%s",s);
  491. XX#ifdef SARG10
  492. XX  readnl();
  493. XX#endif
  494. XX#ifdef SARG20
  495. XX  readnl();
  496. XX#endif
  497. XX}
  498.  
  499. XXinflush() {
  500.  
  501. XX  /*
  502. XX   *   Flush input buffer, make sure no pending input character
  503. XX   */
  504.  
  505. XX  int val;
  506.  
  507. XX#ifdef UNIX
  508. XX#ifdef XENIX
  509. XX  while(rdchk(0)) read(0,&val,1);
  510. XX#else
  511. XX#ifdef SIII
  512. XX  while(read(2,&val,1));
  513. XX#else
  514. XX  long l1;
  515. XX  ioctl (0, FIONREAD, &l1);
  516. XX  while(l1-- > 0L) read(0,&val,1);
  517. XX#endif
  518. XX#endif
  519. XX#endif
  520. XX#ifdef SARG10
  521. XX  while(uuo(051,2,&val))    /* TTCALL 2, (INCHRS)  */
  522. XX    ;
  523. XX#endif
  524. XX#ifdef SARG20
  525. XX  ejsys(CFIBF,_PRIIN);        /* Clear input buffer */
  526. XX#endif
  527. XX}
  528.  
  529. XXzleep(t) int t; {
  530.  
  531. XX/*
  532. XX *    Sleep and do nothing (don't waste CPU) for t milliseconds
  533. XX */
  534.  
  535. XX#ifdef SARG10
  536. XX  calli(072,t);        /* (HIBER) t milliseconds */
  537. XX#endif
  538. XX#ifdef SARG20
  539. XX  ejsys(DISMS,t);    /* DISMISS for t milliseconds */
  540. XX#endif
  541. XX#ifdef UNIX
  542. XX  t = t / 1000;
  543. XX  if (t == 0) t = 1;
  544. XX  sleep(t);        /* UNIX can only sleep whole seconds */
  545. XX#endif
  546. XX}
  547. @//E*O*F esc.c//
  548. chmod u=rw,g=rw,o=rw $OUT
  549.  
  550. echo x - header.h
  551. if test -f header.h ; then
  552.     echo header.h exists, putting output in $$header.h
  553.     OUT=$$header.h
  554.     STATUS=1
  555. else
  556.     OUT=header.h
  557. fi
  558. sed 's/^XX//' > $OUT <<'@//E*O*F header.h//'
  559. XX#define VERSION "1.7b 1985-04-19"
  560.  
  561. XX/* Choose one of these */
  562.  
  563. XX/* #define XENIX        /* XENIX implies UNIX                           */
  564. XX/* #define SIII         /* SIII  implies UNIX, (NDELAY a la System III) */
  565. XX#define UNIX            /* UNIX                                         */
  566. XX/* #define VMS          /* VMS not done yet -- send me your version!!!! */
  567. XX/* #define SARG20       /* Sargasso C for TOPS-20                       */
  568. XX/* #define SARG10       /* Sargasso C for TOPS-10                       */
  569.  
  570. XX/* These #ifdef:s are implementation dependent stuff for the Sargasso C */
  571. XX/* Unix C barfs on directives like "#strings", so we keep them            */
  572. XX/* indented. Then unix c can't find them, but Sargasso C *can*.        */
  573. XX/* Admittedly kludgey, but it works...)                    */
  574. XX#ifdef SARG10
  575. XX  #define _UNIXCON  /* Make UNIX-flavored I/O on TOPS */
  576. XX  #strings low      /* put strings in lowseg mem so we can modify them. */
  577. XX#endif
  578. XX#ifdef SARG20
  579. XX  #define _UNIXCON  /* Make UNIX-flavored I/O on TOPS */
  580. XX  #strings low      /* put strings in lowseg mem so we can modify them. */
  581. XX  #include <TOPS20.HDR>
  582. XX#endif
  583.  
  584. XX#include <stdio.h>
  585.  
  586.  
  587. XX#ifdef UNIX
  588. XX#include <ctype.h>
  589. XX#include <sgtty.h>
  590. XX#include <signal.h>
  591. XX#include <setjmp.h>
  592. XXjmp_buf intrenv;
  593. XXstruct sgttyb sgttyOrg, sgttyNew;
  594. XXchar stdioBuf[BUFSIZ];
  595. XXint brkrd, reading;
  596. XXextern onterm(), onbrk();
  597. XX#ifdef SIII
  598. XX#include <fcntl.h>
  599. XX#endif
  600. XX#endif
  601. XXint ttymode;
  602. @//E*O*F header.h//
  603. chmod u=rw,g=rw,o=rw $OUT
  604.  
  605. echo Inspecting for damage in transit...
  606. temp=/tmp/sharin$$; dtemp=/tmp/sharout$$
  607. trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
  608. cat > $temp <<\!!!
  609.       13      34     251 Makefile
  610.       57     396    2484 README
  611.       13      54     351 vttest.1
  612.      398    1302    8060 esc.c
  613.       43     201    1397 header.h
  614.      524    1987   12543 total
  615. !!!
  616. wc  Makefile README vttest.1 esc.c header.h | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
  617. if test -s $dtemp ; then
  618.     echo "Ouch [diff of wc output]:"
  619.     cat $dtemp
  620.     STATUS=1
  621. elif test $STATUS = 0 ; then
  622.     echo "No problems found."
  623. else
  624.     echo "WARNING -- PROBLEMS WERE FOUND..."
  625. fi
  626. exit $STATUS
  627.